package com.msb.order.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.msb.order.exception.CommonException;
import com.msb.order.util.Result;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HotSpotRuleController {

    @RequestMapping("/hotspot/{id}")
    @SentinelResource(value = "hotspot",
            blockHandlerClass = CommonException.class,
            blockHandler = "handleException",
            fallbackClass = CommonException.class,
            fallback = "fallback"
    )
    public Result info(@PathVariable("id") Integer id){
        return Result.ok("成功获取数据");
    }
}